<template>
	<div :id="id" class="badgeWhite baseContent" v-if="dataRend">
		<basetitle>
			<slot slot="left">
				<b>{{dataRend.name}}</b>
			</slot>
			<slot slot="right"><div class="rightFontCont"><i class="iconfont icon-shuaxin1 rightFont" @click="refreshFull(dataRend.prn)"></i></div></slot>
		</basetitle>
		<div class="baseCont">
		<div class="overHideen chartContent" :style="{ height: dataRend.itemData.height != '' ? dataRend.itemData.height : defalutHeight }">
			<pie-chart :itemdata="dataRend.itemData" :id="chartId"/>
		</div>
		</div>
	</div>
</template>
<script>
import { generateMixed } from '@/utils/index.js';
import { getFromCache } from '@/utils/cache.js';
 const basetitle =()=>import('@/components/basetitle/index.vue')//
 const  PieChart =()=>import('@/components/Charts/PieChart.vue')//嵌套统计
// import CircularCharts2 from '@/components/Charts/CircularCharts2.vue' //仪表盘
// import RingCharts from "@/components/Charts/RingCharts.vue" //环形统计
// import veRadar from "@/components/Charts/veRadar.vue" //环形统计
import store from '../../../store'
import { mapState, mapActions } from 'vuex'
import {getHomePage,refreshContent} from "../../../api/config.js"
export default {
	name: 'JiuList',
	mixins: [],
	props: {
		className: {
			type: String,
			default: 'baseId' + generateMixed('8')
		},
		id: {
			type: String,
			default: 'baseId' + generateMixed('8')
		},
		width: {
			type: String,
			default: '200px'
		},
		defalutHeight: {
			type: String,
			default: '300px'
		},
		itemdata: {
			default: Object
		},
		itemStyle: {
			default: Object
		}
	},
	components: {
		basetitle,
		// CircularCharts2,
		//  RingCharts,
		//  veRadar,
		 PieChart
	},
	data() {
		return {
			dataRend:null,
      chartId:'chart' + generateMixed('8')
		}
	},
	beforeDestroy() {},
	mounted() {
		this.dataRend=this.itemdata
		console.log("环形值是"+this.dataRend.itemData.height)
	},
	methods: {
		...mapActions('base', ['getIndexRend']),
		refreshFull(type){
			let that=this;
			let parms={};
			parms.type=type;
      parms.user_prn = JSON.parse(getFromCache('userInfo')).env$user_prn;
			that.$post(refreshContent, parms).then(response => {
				that.dataRend=response.obj
			})
		}
	},
	watch:{
		 mainRend(){
			 this.dataRend=this.mainRend
		 }
	}
}
</script>

<style>

</style>
